<?php
/**
 * @fileoverview	粉丝列表页
 * @author          zhanglei11
 * @date			Feb  02 11:31:49 CST 2012
 * @copyright       sina meila
 */
include_once ('../../__global.php');
include_once ('listBase.php');


class fansList extends listBase {
	
	public function main(){
		$uid = $this->uid;	
		if(empty($uid)) {
			$this->redirect(ML_PAGE_404);
		}
		
		ml_tool_actionlog::add_other_action($this->__visitor['uid'] , ML_SINAACTCODE_VIEW_HOME_FANS , $uid);
		
		if($this->page == 1 && $uid == $this->__visitor['uid'])
		{
			$oRds = new ml_model_rdsNotice();
			$oRds->clean_one_field($uid , ml_model_rdsNotice::NTCTYPE_ADDFANS);
		}
		//	获得粉丝uids
		$uids = $this->getUids($uid,1);
		$data = $this->getUser($uid, $this->__visitor['uid']);
		$this->set_scope_var('$skilltags',$data['skill_tags']);
		// 找出uid的粉丝数
		//$selfFSCnt =  $this->oCount->getFansCnt($uid);
		

		$this->oFans->countFans($uid);   //暂时从表中取总数
		$selfFSCnt  = $this->oFans->get_data();
		$selfFSCnt = $selfFSCnt > 0 ? $selfFSCnt : 0;
		
		
		if($selfFSCnt == 0) {
			$data['list'] = array();
		}else {
			$data['list'] = $this->getList($uid, $uids);
		}
		
		$oIFollow = new ml_biz_module_iFollow();
		$data['iFollow'] = $oIFollow->getList($uid,$this->__visitor['uid']);
		
		$this->set_scope_var('$totalPage', ceil($selfFSCnt/ML_FANS_PAGESIZE));//总页数
		$this->set_scope_var('$currentPage', intval($this->page));//当前页
		$title = $this->__visitor['uid'] == $uid ? '关注我的人' :  '关注'.$data['nickname'].'的人';
		$data['who'] = $this->__visitor['uid'] == $uid ? '我' :  '她';
		$data['title'] = $title;
		$this->set_page_title($title);
		$this->page_output('user::fanslist',$data);
	}
	
	
	


}
new fansList();
?>